﻿<Window x:Class="DemoCommand.SayHelloUserdefCmd"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="SayHelloUserdefCmd" Height="168" Width="300">
    <Window.Resources>
        <Style TargetType="TextBox">
            <Setter Property="Margin" Value="5"/>
        </Style>
        <Style TargetType="Button">
            <Setter Property="Margin" Value="5"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBox Grid.Row="0" Name="tbxHello"/>
        <Button Grid.Row="1" Content="Say Hello" 
                Command="{Binding SayhelloCmd}"
                CommandParameter="{Binding ElementName=tbxHello, Path=Text}"/>
        <Button Grid.Row="2" Content="{Binding Path=Counter}"
                Command="{Binding IncrementCmd}"/>
    </Grid>
</Window>
